﻿// <copyright file="UnknownDataReceivedEventArgs.cs" company="Hallvard Korsgaard">
//  Microsoft Public License (Ms-PL). See license details here: http://enoceannet.codeplex.com/license
// </copyright>
// <author>Hallvard Korsgaard</author>

namespace StcEthernet
{
  using System;

  /// <summary>
  ///  Provides data for the UnknownDataReceivedEventArgs event.
  /// </summary>
  [Serializable]
  public class UnknownDataReceivedEventArgs : EventArgs
  {
    /// <summary>
    /// Initializes a new instance of the UnknownDataReceivedEventArgs class.
    /// </summary>
    /// <param name="exception">The exception associated with this error. Might be null.</param>
    /// <param name="data">The received data that could not be interpreted.</param>
    internal UnknownDataReceivedEventArgs(Exception exception, byte[] data)
    {
      this.Exception = exception;
      this.Data = data;
    }

    /// <summary>
    /// Gets the exception associated with this error. Might be null.
    /// </summary>
    public Exception Exception
    {
      get;
      private set;
    }

    /// <summary>
    /// Gets the received data.
    /// </summary>
    public byte[] Data
    {
      get;
      private set;
    }
  }
}
